home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / Item Class / Item headers / CItemTable.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  3.0 KB  |  107 lines  |  [TEXT/KAHL]

  1. /*
  2.  * File:        CItemTable.c
  3.  * Created:        7/25/93
  4.  * Desc:        
  5.  *
  6.  * Superclass:    CArrayPane.
  7.  * Uses:        CItem.
  8.  * Original Author:    Atul Barve
  9.  * Modifications:    W. Wesley Monroe
  10.  *
  11.  * Copyright © 1993 Animas Software Production. All rights reserved.
  12.  */
  13.  
  14. #define _H_CItemTable
  15. #include    <CTable.h>
  16.  
  17. #include "CArrayPane.h"
  18. #include "CItem.h"
  19. #include "CItemList.h"
  20.  
  21. #include    "CTypingTask.h"
  22.  
  23. #define selUseSence        16L        // Other Flags are defined in CTable.h.
  24. #define selWholeLine    32L        // Table works like it has only one col
  25. #define selCanDrag        64L        // Can you drag from this list???
  26. #define selCanRecieve    128L    // Can you Drop in this list
  27.  
  28. enum {
  29.     kDragInPaneOnly = 0x0001,
  30.     kDragInWindow = 0x0002
  31. };
  32.  
  33. class CItemTable : public CArrayPane
  34. {
  35.     CItemList    *fSelItems;
  36.  
  37.     short        fDragFlag;
  38.  
  39. public:
  40.  
  41.     CTypingTask    *fTypingTask;
  42.  
  43.     virtual    void     IItemTable( CView *anEnclosure, CBureaucrat *aSupervisor,
  44.                             short aWidth, short aHeight,
  45.                             short aHEncl, short aVEncl,
  46.                             SizingOption aHSizing, SizingOption aVSizing,
  47.                             short dragFlag);
  48.     
  49.     void             IViewTemp(CView *anEnclosure, CBureaucrat *aSupervisor, Ptr viewData);
  50.     void             SetDragFlag(short flag);
  51.  
  52.     void             AnimateOpenClose(Cell hitCell);
  53.     void            ExpandCollaspeSelection(short expandColaspe);
  54.     virtual void     GetCellText( Cell aCell, short availableWidth, StringPtr itsText);
  55.  
  56.     virtual    void     DrawCell(Cell theCell, Rect *cellRect);
  57.     virtual void    Draw7Icon(Rect *cellRect,short indentLeft, short id, short xfer);
  58.     virtual void    TrackMouse(CMouseTask *theTask, LongPt *startPt,
  59.                                 LongRect *pinRect);
  60.  
  61.     virtual    void     DrawTriangle(Rect *cellRect, short level,short id);
  62.     virtual    void    Draw( Rect *area);
  63.  
  64.     virtual    void     ExpandCell(Cell theCell, short expand);
  65.  
  66.         // Keyboard handeling...
  67.     virtual void    DoKeyDown(char theChar, Byte keyCode, EventRecord *macEvent);
  68.     virtual void    DoTyping(char theChar);
  69.     virtual void    SelectMatchingText(char *buff);
  70.  
  71.         // Mouse Handeling
  72.     virtual CMouseTask *MakeMouseTask(short modifiers);
  73.     virtual Boolean GetCanRecieve(void);
  74.     Boolean ItemCanAcceptDrop(Cell hitCell, CItemList *selectedItems);
  75.  
  76.  
  77.         // Hiliting...
  78.     virtual    void         Hilite(Rect *cells, Boolean hiliteFlag);
  79.     virtual void        DeselectRect(Rect *deselectRect, Boolean redraw);
  80.     virtual    void         HiliteCellRegion(RgnHandle cellRgn, Boolean fHilite);
  81.     virtual CItemList    *GetHiliteRgn(RgnHandle *rgnHdl);
  82.     virtual Boolean     HitInDrag(Cell aCell);
  83.  
  84.     virtual Boolean        HasSelection(void);
  85.  
  86.     virtual    CItem     *GetItem(short row);
  87.     virtual    void     GetCellRect( Cell theCell, register LongRect *cellRect);
  88.  
  89.     virtual void    DeleteSelectedItems(void);
  90.     virtual Boolean DropedSameParent(short dropCell, CItem *theItem);
  91.     virtual void    RemoveSubviews(CItemList *selectedItems);
  92.     virtual void    GraftItems(CItem *parent, CItemList *selectedItems);
  93.     virtual void    AddItemToRoot(CItem *itemToGraft);
  94.     virtual    void     CreateTextEnvironment(void);
  95. };
  96.  
  97. // Change interface...
  98. enum {
  99.  
  100.     itemTableItemAdded = tableLastChange + 1,
  101.     itemTableItemRemoved,
  102.     itemTableItemExpanded,
  103.     itemTableItemMoved,
  104.     itemTableLastChange = itemTableItemMoved
  105. };
  106.  
  107.